package org.oep.widgets;

import javax.microedition.lcdui.Font;
import javax.microedition.lcdui.Graphics;

public class EZText {
	public static void paint(Graphics g, String s, Font f, int x, int y, int width) {
		String [] lines = Utils.addLineBreaks(s, f, width);
		int fontHeight = f.getHeight();
		int startPoint = y - lines.length * fontHeight / 2;
		for(int i = 0; i < lines.length; i++) {
			g.drawString(lines[i], x, startPoint + i * fontHeight, Graphics.HCENTER | Graphics.BOTTOM);
		}
	}
}
